#include <LedControl.h>

int DIN = 13;

int CS = 12;

int CLK = 14;

byte e[8]= {0x66,0xFF,0xFF,0xFF,0xFF,0x7E,0x3C,0x18}; //E

byte d[8]= {0x00,0x66,0xFF,0xFF,0x7E,0x3C,0x18,0x00}; //D

byte u[8]= {0x66,0x66,0x66,0x66,0x66,0x66,0x7E,0x7E}; //U

byte c[8]= {0x7E,0x7E,0x60,0x60,0x60,0x60,0x7E,0x7E}; //C

byte eight[8]= {0x7E,0x7E,0x66,0x7E,0x7E,0x66,0x7E,0x7E}; //8

byte s[8]= {0x7E,0x7C,0x60,0x7C,0x3E,0x06,0x3E,0x7E}; //S

byte dot[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18}; //。

byte o[8]= {0x7E,0x7E,0x66,0x66,0x66,0x66,0x7E,0x7E}; //O

byte m[8]= {0x10,0x38,0x54,0x92,0x10,0x10,0x10,0x10}; //M
LedControl lc = LedControl(DIN,CLK,CS,3);

void setup(){

lc.shutdown(0,false); //启动时,MAX72XX处于省电模式
lc.shutdown(1,false); //启动时,MAX72XX处于省电模式
lc.clearDisplay(0); //清除显示
lc.clearDisplay(1); //清除显示
}

void loop(){

byte smile[8]= {0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C};//笑脸

byte neutral[8]= {0x3C,0x42,0xA5,0x81,0xBD,0x81,0x42,0x3C};//标准脸

printByte(e);//显示8

delay(1000);//延时1秒
printByte(d);//显示8

delay(1000);//延时1秒

}
void printByte(byte character[])
{
lc.clearDisplay(0);
lc.clearDisplay(1);
int i = 0;
for(;i<8;i++)
{

lc.setRow(0,i,character[i]);
lc.setRow(1,i,character[i]);
}
}
